<template>
	<div class="auto">
		<button @click="unpack()">打开</button>
		<button @click="Off()">关闭</button>
		
		<iframe name=123
		id="myIframe"
		allowtransparency="false"
		align=middle marginwidth=0 
		marginheight=0 vspace=-170 
		hspace=0 src=""  
		frameborder=no 
		scrolling=no  width=776  height=500></iframe>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods:{
			unpack(){
				// 获取iframe元素
				var iframe = document.getElementById("myIframe")
				
				// 打开iframe
				iframe.src = "http://localhost:8080" // 设置要加载的URL
			},
			Off(){
				// 获取iframe元素
				var iframe = document.getElementById("myIframe")
				
				// 关闭iframe
				iframe.src=""
			}
		}
	}
</script>

<style>
.auto{
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}	
</style>